package com.immortal.ai.etity.vo;

import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.ai.chat.messages.Message;

/**
 * @author ywh
 * @version 1.0
 * @description: TODO
 * @date 2025/6/11 17:28
 */
@NoArgsConstructor
@Data
public class MessageVO {

    private String role;

    private String content;

    public MessageVO(Message message) {
        switch (message.getMessageType()) {
            case USER:
                role = "user";
                break;
            case ASSISTANT:
                role = "assistant";
                break;
            default:
                role = "unKnow";
                break;
        }
        this.content = message.getText();
    }
}
